import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import {Provider} from 'react-redux'
import {createStore,applyMiddleware} from 'redux'
import thunk from 'redux-thunk'
import rootReducer from './reduxces'
const store = createStore(rootReducer,applyMiddleware(thunk))
export default class Hello extends Component{
    constructor(props){
        super(props);
        this.state={

        }
    }
    render(){
        return(
            <Provider store={store}>
                <div>
                    <App/>
                </div>
            </Provider>
        )
    }
}

ReactDOM.render(<Hello />, document.getElementById('root'));
//在这里首先引入Provider 和createStore 两个高阶组件  引入reduxces中的方法
//然后声明一个store 生成链接数据层的方式
//写一个类组件 将App组件放入Provider高阶组件当中
//最后渲染到页面
// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister();
